import request from '@/router/axios';
import {downloadExcel} from '@/router/axios';
import {formatCondition} from '@/util/util';
//单条查询
export const querySysModuleConfigInfo = (params) => {
  params.head.transCode = 'querySysModuleConfigInfo';
  return request({
    url: '/platform/sysModuleConfigInfo/querySysModuleConfigInfo',
    method: 'post',
    data: params
  })
}
//多条列表查询，支持条件查询
export const querySysModuleConfigInfoListPage = (params) => {
  params.head.transCode = 'querySysModuleConfigInfoListPage';
  return request({
    url: '/platform/sysModuleConfigInfo/querySysModuleConfigInfoListPage',
    method: 'post',
    data: params
  })
}
//新增单条记录
export const saveSysModuleConfigInfo = (params) => {
  params.head.transCode = 'saveSysModuleConfigInfo';
  return request({
    url: '/platform/sysModuleConfigInfo/saveSysModuleConfigInfo',
    method: 'post',
    data: params
  })
}
//新增多条记录
export const saveSysModuleConfigInfoList = (params) => {
  params.head.transCode = 'saveSysModuleConfigInfoList';
  return request({
    url: '/platform/sysModuleConfigInfo/saveSysModuleConfigInfoList',
    method: 'post',
    data: params
  })
}
//新增或修改单条记录
export const saveOrUpdateSysModuleConfigInfo = (params) => {
  params.head.transCode = 'saveOrUpdateSysModuleConfigInfo';
  return request({
    url: '/platform/sysModuleConfigInfo/saveOrUpdateSysModuleConfigInfo',
    method: 'post',
    data: params
  })
}


//新增或修改单条记录
export const saveOrUpdateSysModuleConfigInfoList = (params) => {
  params.head.transCode = 'saveOrUpdateSysModuleConfigInfoList';
  return request({
    url: '/platform/sysModuleConfigInfo/saveOrUpdateSysModuleConfigInfoList',
    method: 'post',
    data: params
  })
}

//修改单条记录
export const updateSysModuleConfigInfo = (params) => {
  params.head.transCode = 'updateSysModuleConfigInfo';
  return request({
    url: '/platform/sysModuleConfigInfo/updateSysModuleConfigInfo',
    method: 'post',
    data: params
  })
}

//删除单条记录
export const deleteSysModuleConfigInfo = (params) => {
  params.head.transCode = 'deleteSysModuleConfigInfo';
  return request({
    url: '/platform/sysModuleConfigInfo/deleteSysModuleConfigInfo',
    method: 'post',
    data: params
  })
}

//删除多条记录
export const deleteSysModuleConfigInfoList = (params) => {
  params.head.transCode = 'deleteSysModuleConfigInfoList';
  return request({
    url: '/platform/sysModuleConfigInfo/deleteSysModuleConfigInfoList',
    method: 'post',
    data: params
  })
}
//导出excel
export const exportSysModuleConfigInfoExcel = (params) => {
  downloadExcel({
    url: '/platform/sysModuleConfigInfo/excelDownload/exportSysModuleConfigInfoExcel',
    method: 'get',
    data: 
    {
      tenantId: params.head.tenantId,
      orders:'',
      condition: formatCondition(params.body.sqlCondition)
    }
  })
}

//查询表名
export const queryTableList = (params) => {
  params.head.transCode = 'queryTableList';
  return request({
    url: '/platform/sysModuleConfigInfo/queryTableList',
    method: 'post',
    data: params
  })
}

//查询表名
export const pushBaseData = (params) => {
  params.head.transCode = 'pushBaseData';
  return request({
    url: '/platform/sysModuleConfigInfo/pushBaseData',
    method: 'post',
    data: params
  })
}
